home *** CD-ROM | disk | FTP | other *** search
/ Mac Format 1994 October / Macformat17.cdr / Shareware in MacFormat / SwitchBack 2.4 / SwitchBack Help / SwitchBack Help.rsrc / TEXT_133_AppleScript.txt < prev    next >
Text File  |  1994-07-11  |  1KB  |  20 lines

  1. AppleScript
  2.  
  3. SwitchBack supports the required AppleEvent suite, and is fully AppleScript-aware.  You can use AppleScript to execute a series of backups automatically.  Programs that permit scheduled execution of scripts can permit you to do a daily backup, and then shut the machine off.  This capability is very powerful, and extends SwitchBack‚Äôs usefulness.
  4.  
  5. The following script launches SwitchBack (if it is not already running), brings it to the front and opens four backup documents in sequence.  These documents should be set to start automatically.  Once completed, SwitchBack is told to quit.  The final command sends a ‚ÄúShut Down‚Äù event to the Finder to turn the machine off.
  6.  
  7.     tell application "SwitchBack 2.4"
  8.         activate
  9.     
  10.         open alias "Flying Disc:Backups:Data"
  11.         open alias "Flying Disc:Backups:Development 1"
  12.         open alias "Flying Disc:Backups:Development 2"
  13.         open alias "Flying Disc:Backups:Libraries"
  14.     
  15.         quit
  16.     end tell
  17.  
  18.     tell application "Finder" to ¬´event FNDRshut¬ª
  19.  
  20. If you are using AppleScript, you should set SwitchBack‚Äôs preference After Auto-Start to Do Nothing.  In this way SwitchBack will remain the frontmost application for each document opened, while AppleScript controls it from the background.